 package com.ruoyi.back.v2.domain

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.ruoyi.app.common.PageData
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.util.*
import javax.persistence.*

@Entity
@TableName("fly_promote_relationship")
@Table(name = "fly_promote_relationship")
@ApiModel("推广关系")
data class PromoteRelationship(

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id 更新的时候需要传递")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    @ApiModelProperty("用户id")
    var userId: Long? = null,

    @ApiModelProperty("一级&上级用户id")
    var firstLevel: Long? = null,

    @ApiModelProperty("二级&上上级用户id")
    var secondLevel: Long? = null,

    @ApiModelProperty("收益余额")
    var employeeMoney: Double? = 0.0,
)

@Entity
@TableName("fly_invite_detail")
@Table(name = "fly_invite_detail")
@ApiModel("邀请明细")
data class InviteDetail(

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id 更新的时候需要传递")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    @ApiModelProperty("用户id")
    var userId: Long? = null,

    @ApiModelProperty("被邀请人")
    var inviteUserId: Long? = null,

    @ApiModelProperty("被邀请人id")
    var inviteUserIdStr: String? = null,

    @ApiModelProperty("被邀请人昵称")
    var inviteUserName: String? = null,

    @ApiModelProperty("1: 一级 2: 二级")
    var inviteLevel: Int? = null,

    @ApiModelProperty("邀请类型 0: 免费会员 1:推广赚钱")
    var inviteType: Int? = null,

    @ApiModelProperty("邀请使用状态 针对于免费会员的使用额度")
    var inviteUseStatus: Boolean? = false,

    @ApiModelProperty("年")
    var year: Int? = null,

    @ApiModelProperty("月")
    var month: Int? = null,

    @ApiModelProperty("日")
    var day: Int? = null,

    @ApiModelProperty("邀请时间", hidden = true)
    var createTime: Date? = Date(),
)

@Entity
@TableName("fly_withdrawals_detail")
@Table(name = "fly_withdrawals_detail")
@ApiModel("提现明细")
data class WithdrawalsDetail(

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id 更新的时候需要传递")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    @ApiModelProperty("用户id")
    var userId: Long? = null,

    @ApiModelProperty("用户ID")
    var userIdStr: String? = null,

    @ApiModelProperty("用户昵称")
    var username: String? = null,

    @ApiModelProperty("提现金额")
    var money: Double? = null,

    @ApiModelProperty("1. 微信 2.支付宝")
    var withdrawType: Int? = null,

    @ApiModelProperty("审核状态 0待审核 1审核成功 2审核失败")
    var checkStatus: Int? = 0,

    @ApiModelProperty("失败原因")
    var errorMsg: String? = null,

    @ApiModelProperty("申请提现时间", hidden = true)
    var createTime: Date? = Date(),
)

@Entity
@TableName("fly_employee_detail")
@Table(name = "fly_employee_detail")
@ApiModel("收益明细")
data class EmployeeDetail(

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id 更新的时候需要传递")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    @ApiModelProperty("收益人")
    var userId: Long? = null,

    @ApiModelProperty("提供人")
    var providerUserId: Long? = null,

    @ApiModelProperty("提供人等级 1: 1级 2: 2级")
    var employeeLevel: Int? = null,

    @ApiModelProperty("提供信息")
    var providerDesc: String? = null,

    @ApiModelProperty("收益金额")
    var employeeMoney: Double? = null,

    @ApiModelProperty("收益类型 1.加 2.减")
    var employeeType: Int? = 1,

    @ApiModelProperty("年")
    var year: Int? = null,

    @ApiModelProperty("月")
    var month: Int? = null,

    @ApiModelProperty("日")
    var day: Int? = null,

    @ApiModelProperty("收益时间", hidden = true)
    var createTime: Date? = Date(),
)

@Entity
@TableName("fly_spread_setting")
@Table(name = "fly_spread_setting")
@ApiModel("推广设置")
data class SpreadSetting(

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id 更新的时候需要传递")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    @ApiModelProperty("一级返回佣金 百分比")
    var firstReturnCommission: Double? = 20.0,

    @ApiModelProperty("二级返回佣金 百分比")
    var secondReturnCommission: Double? = 5.0,

    @ApiModelProperty("最小提现金额")
    var withdrawMinMoney: Double? = 0.0,

    @ApiModelProperty("最大提现金额")
    var withdrawMaxMoney: Double? = 100.0
)

@ApiModel("绑定邀请关系参数")
data class BindUserRelationParam(

    @ApiModelProperty("当前用户id")
    var userId: Long? = null,

    @ApiModelProperty("邀请人id")
    var inviteUserId: Long? = null,
)

@ApiModel("绑定收益关系参数")
data class BindEmployeeRelationParam(

    @ApiModelProperty("支付人")
    var userId: Long? = null,

    @ApiModelProperty("支付金额")
    var payAmount: Double? = null,

    @ApiModelProperty("购买类型(1. 购买会员 2.定制数字人 3.数字人换脸)")
    var payProgramType: Int? = null,
)




